//
//  MLDropdownView+Convenient.m
//  MSHandbook
//
//  Created by molon on 14/11/12.
//  Copyright (c) 2014年 molon. All rights reserved.
//

#import "MLDropdownView+Convenient.h"

@implementation MLDropdownView (Convenient)

+ (MLDropdownView*)showInView:(UIView*)view message:(NSString*)message backgroundColor:(UIColor*)backgroundColor andTapBlock:(void (^)())didTapBlock
{
    MLDropdownView *dropdownView = [[self class]showInView:view message:message backgroundColor:backgroundColor messageColor:nil font:nil animated:YES hideAfterDelay:kDefaultHideAfterDelay];
    if (dropdownView) {
        [dropdownView setDidTapBlock:didTapBlock];
    }
    return dropdownView;
}

+ (MLDropdownView*)showRedInView:(UIView*)view message:(NSString*)message andTapBlock:(void (^)())didTapBlock
{
    return [[self class]showInView:view message:message backgroundColor:[UIColor colorWithRed:0.961 green:0.145 blue:0.255 alpha:0.88] andTapBlock:didTapBlock];
//    return [[self class] showGrayInView:view message:message andTapBlock:didTapBlock];
}

+ (MLDropdownView*)showGreenInView:(UIView*)view message:(NSString*)message andTapBlock:(void (^)())didTapBlock
{
#define kGreenColor [UIColor colorWithRed:0.177 green:0.599 blue:0.592 alpha:0.92f]
//#define kGreenColor [UIColor colorWithRed:0.150 green:0.663 blue:0.360 alpha:0.92f]
    return [[self class]showInView:view message:message backgroundColor:kGreenColor andTapBlock:didTapBlock];
}

+ (MLDropdownView*)showGrayInView:(UIView*)view message:(NSString*)message andTapBlock:(void (^)())didTapBlock
{
    return [[self class]showInView:view message:message backgroundColor:[UIColor colorWithWhite:0.500 alpha:0.88f] andTapBlock:didTapBlock];
}


@end
